package com.demo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 预防药物类目（型）
 * @author ZM
 * @since 2020-11-19
 */
@Data
@TableName("pd_medicine_cate")
@ApiModel(value="MedicineCate对象", description="预防药物类目（型）")
public class MedicineCate implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "类目ID")
    @TableId(value = "medicine_cate_id", type = IdType.AUTO)
    private Integer medicineCateId;

    @ApiModelProperty(value = "类目名称")
    @TableField("category")
    @NotBlank(message = "类目名称不能为空")
    private String category;

    @ApiModelProperty(value = "排序不能为空")
    @TableField("item_sort")
    @NotNull(message = "排序不能为空")
    private Integer itemSort;

    @ApiModelProperty(value = "指南建议")
    @TableField("proposal")
    @Size(max = 200, message = "指南建议最大支持 200 字")
    private String proposal;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    @NotNull(message = "创建人ID不能为空")
    private Integer createdUserId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "删除人ID")
    @TableField("deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "删除时间")
    @TableField(value = "deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

}
